//
//  JSTSignatureCell.m
//  KYKJPackDemo
//
//  Created by 01 on 17/6/19.
//  Copyright © 2017年 ???. All rights reserved.
//

#import "JSTSignatureCell.h"

@interface JSTSignatureCell ()
@end

@implementation JSTSignatureCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (id) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        _label = [[UILabel alloc] init];
        CGFloat labelX = EvaluationCellInset;
        CGFloat labelY = EvaluationCellInset;
        CGSize maxSize = [NSString sizeWithString:@"个性签名:" font:kSystemFont(kCurrentScreenWidth(12)) CGsize:CGSizeMake(kDeviceWidth, MAXFLOAT)];
        _label.frame = (CGRect){{labelX, labelY}, maxSize};
        _label.text = @"个性签名:";
        _label.font = kSystemFont(kCurrentScreenWidth(12));
        _label.textAlignment = NSTextAlignmentCenter;
        [self addSubview:_label];
        
        _textView = [[UITextView alloc] init];
        [self addSubview:_textView];
    }
    return self;
}

- (void) createContent:(NSString *)str blockNewStr:(void (^)(NSString *))newStr
{
    CGFloat labelX = EvaluationCellInset;
    CGFloat labelY = EvaluationCellInset;
    CGSize maxSize = [NSString sizeWithString:@"个性签名:" font:kSystemFont(kCurrentScreenWidth(12)) CGsize:CGSizeMake(kDeviceWidth, MAXFLOAT)];
    _label.frame = (CGRect){{labelX, labelY}, maxSize};
    _label.text = @"个性签名:";
    _label.font = kSystemFont(kCurrentScreenWidth(12));
    _label.textAlignment = NSTextAlignmentCenter;
    
    CGFloat textFdX = CGRectGetMaxX(_label.frame) + EvaluationCellInset;
    CGFloat textFdY = EvaluationCellInset/2.;
    CGFloat textFdW = kDeviceWidth - textFdX - EvaluationCellInset*2;
    CGFloat textFdH = kCurrentScreenWidth(50);
    _textView.frame = CGRectMake(textFdX, textFdY, textFdW, textFdH);
    _textView.text = str;
    _textView.font = kSystemFont(kCurrentScreenWidth(10));
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
